# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Content.V21.Model.PriceCompetitiveness do
  @moduledoc """
  Price competitiveness fields requested by the merchant in the query. Field values are only set if the merchant queries `PriceCompetitivenessProductView`. https://support.google.com/merchants/answer/9626903

  ## Attributes

  *   `benchmarkPriceCurrencyCode` (*type:* `String.t`, *default:* `nil`) - The price benchmark currency (ISO 4217 code).
  *   `benchmarkPriceMicros` (*type:* `String.t`, *default:* `nil`) - The latest available price benchmark in micros (1 millionth of a standard unit, 1 USD = 1000000 micros) for the product's catalog in the benchmark country.
  *   `countryCode` (*type:* `String.t`, *default:* `nil`) - The country of the price benchmark (ISO 3166 code).
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :benchmarkPriceCurrencyCode => String.t() | nil,
          :benchmarkPriceMicros => String.t() | nil,
          :countryCode => String.t() | nil
        }

  field(:benchmarkPriceCurrencyCode)
  field(:benchmarkPriceMicros)
  field(:countryCode)
end

defimpl Poison.Decoder, for: GoogleApi.Content.V21.Model.PriceCompetitiveness do
  def decode(value, options) do
    GoogleApi.Content.V21.Model.PriceCompetitiveness.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Content.V21.Model.PriceCompetitiveness do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
